package com.user.entity;


import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;

/**
 * @author zhangyan
 * @date 2022/10/4
 */
@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserInfo {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    @NotBlank(message = "用户名不能为空.")
    private String username;
    @NotBlank(message = "密码不能为空.")
    private String password;
    @Range(message = "年龄范围为 {min} 到 {max} 之间", min = 1, max = 120)
    private Integer age;

    private Integer sex;

}
